home *** CD-ROM | disk | FTP | other *** search
- #ifndef CLASS_PROGRESSBAR_H_
- #define CLASS_PROGRESSBAR_H_
-
- typedef class ProgressBar {
- public:
- // "B&W" version
- ProgressBar(Rect *theBounds, short max, short cur, GrafPtr owner);
- // Color version
- ProgressBar(Rect *theBounds, short max, short cur, GrafPtr owner,
- RGBColor *fill, RGBColor *bkgnd);
-
- virtual void Update(); // Draw without incrementing
- virtual void Increment(); // Increment & then draw
- virtual void IncrementBy(short stepValue); // Increment by adding stepValue, then draw
- virtual void IncrementTo(short newCurVal); // Increment to newCurVal & then draw
-
- virtual void SetStep(short step) { stepVal = step; }
- virtual void SetFillColor(RGBColor *newColor) { fillColor = *newColor; }
- virtual void SetBkgndColor(RGBColor *newColor) { bkgndColor = *newColor; }
- virtual void SetSmoothUpdate(Boolean smooth) { smoothProgress = smooth; }
- virtual Boolean IsDone() { return(curVal >= maxVal); }
-
- protected:
- GrafPtr ownerPort;
- Rect bkgndRect, fillRect, frameRect;
- short maxVal;
- short curVal;
- short stepVal; // Defaults to 1.
- Boolean smoothProgress; // Fill up every pixel or just jump to current value?
- // Default to true.
- Boolean setupYet;
-
- Boolean useFillColor; // Default to false (if not specified)
- Boolean useBkgndColor; // Ditto
-
- RGBColor fillColor;
- RGBColor bkgndColor;
-
- virtual void Draw();
- } *ProgressBarPtr, **ProgressBarHdl;
-
- #endif // CLASS_PROGRESSBAR_H_